#include <iostream>

class Complex
{
public:
    Complex():real(0),vir(0){}
    Complex(int real,int vir):real(real),vir(vir){}
    
    Complex operator+(const Complex& c)
    {
        Complex result;
        result.real = c.real + this->real;
        result.vir = c.vir + this->vir;
        return result;
    }

    Complex operator-(const Complex& c)
    {
        Complex result;
        result.real = this->real - c.real;
        result.vir = this->vir-c.vir;
        return result;
    }
    //后置++
    Complex operator++(int)
    {   
        std::cout<<"后置++\n";
        Complex result = *this;
        this->real++;
        this->vir++;
        return result;
    }
    //前置++
    Complex& operator++()
    {   
        std::cout<<"前置++\n";
        this->real++;
        this->vir++;
        return *this;
    }
    void show()
    {
        std::cout<<real<<"+"<<vir<<"i"<<std::endl;
    }
    friend std::ostream& operator<<(std::ostream&os,const Complex&c);
    friend std::istream& operator>>(std::istream&is,Complex& c);
   
private:
    int real;
    int vir;
};
//全局重载
std::ostream& operator<<(std::ostream&os,const Complex&c)
    {
        os<<c.real<<"+"<<c.vir<<"i";
        return os;
    }

std::istream& operator>>(std::istream&is,Complex& c)
{
    is>>c.real>>c.vir;
    return is;
}
int main()
{
    Complex c1(1,2);
    Complex c2(2,3);
    // c2 = ++c1;
    std::cin>>c2;
    std::cout << c2 <<std::endl;


    return 0;
}